import Articles from "./Articles";
import Tags from "./Tags";
import ArticleTag from "./ArticleTag";

// 中间表关系
Articles.belongsToMany(Tags, {
  through: ArticleTag,
  foreignKey: "article_id",
  otherKey: "tag_id",
});

Tags.belongsToMany(Articles, {
  through: "article_tags",
  foreignKey: "tag_id",
  otherKey: "article_id",
});

export { Articles, ArticleTag, Tags };
